﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.hebg3.util {
  public class SysUtils {
    /// <summary> 得到用户目录
    /// </summary>
    /// <returns></returns>
    public static String getUserDir() {
      String userDir = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
      return userDir;
    }
    /// <summary>得到用户目录中本程序文件夹 
    /// </summary>
    /// <returns></returns>
    public static String getUserAppDir(){
      return getUserDir() + "\\" + AppKeyConstants.APP_NAME;
    }
    /// <summary>得到用户目录中本程序zip文件全路径
    /// </summary>
    /// <returns></returns>
    public static String getUserAppZipFilePath() {
      return getUserAppDir() + "/" + AppKeyConstants.ZIP_FILE_NAME;
    }
    /// <summary>得到用户目录中本程序存放应用的文件夹全路径
    /// </summary>
    /// <returns></returns>
    public static String getUserAppAppsDir() {
      return getUserAppDir() + "\\" + AppKeyConstants.APP_APPS_DIR_NAME;
    }
    /// <summary>得到用户目录中本程序记载发布应用的xml的全路径名
    /// </summary>
    /// <returns></returns>
    public static String getUserAppAppsXmlPath() {
      return getUserAppAppsDir() + "/" + AppKeyConstants.APP_XML_FILE_NAME;
    }
    /// <summary>得到用户配置文件</summary>
    /// <returns></returns>
    public static String getUserConfigFile() {
      return getUserAppDir() + "/" + AppKeyConstants.USER_CONFIG_FILE;
    }
    /// <summary>得到安装文件</summary>
    /// <returns></returns>
    public static String getInstallRegFile() {
      return (getUserAppDir() + "/" + AppKeyConstants.INSTALL_REG).Replace("\\","/");
    }
  }
}
